from datetime import datetime

def day_input():
    "输入日期保存到字典"
    day_dict = {}
    while True :
        holiday = input("输入节日名称")
        if holiday == "" :
            break
        day = input("输入日期")
        day_dict[holiday] = day
    return day_dict
def day_betweem(date1 ,date2)  :
    minus = date2 - date1
    if minus.days > 0 :
        return  f"还有{minus.days}天"
    else :
        return f"已经过了{-minus.days}天"
def display(result_dict) :
    print("*"*40)
    for holiday,count in result_dict.items() :
        print(f"距离{holiday}{count}")
        print("*"*40)
if __name__ == "__main__" :
    input_dict = day_input()
    today = datetime.now()
    today = today.strftime("%Y-%m-%d")
    today = datetime.strptime(today,"%Y-%m-%d")
    count_dict = {}
    for key,value in input_dict.items() :
        value = datetime.strptime(value,"%Y-%m-%d")
        result = day_betweem(today,value)
        count_dict[key] = result
    display(count_dict)